<?php
namespace addon\cms\validate;
use app\common\validate\ValidateBase;
use think\Db;
class PostsComments extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'author'                 => 'require',
        'email'                 => 'require',
        'comment'               => 'require',
        'posts_id'               => 'require',
    ];
    // 验证提示
    protected $message = [
        'comment.require'             => '还是写点内容吧',
    ];
    // 应用场景
    protected $scene = [
        'add'=>['comment','posts_id']
    ];
}